Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
QUERY-OPEN method
Once you have prepared a query you need to open it, using the
QUERY-OPENmethod:
The
QUERY-PREPAREandQUERY-OPENmethods together accomplish what theOPEN QUERYstatement does for a static query. The two methods are separated out to enable you to define the selection and sort criteria for a query separately from opening it. You might want to reopen the same query several times with the sameFOR EACHstatement, for example, to capture changes to the underlying data theFOR EACHstatement retrieves. Having two separate methods gives you this flexibility. It also allows you to verify that theFOR EACHstatement in aQUERY-PREPAREis valid before you try to open the query.You can use the
QUERY-PREPAREandQUERY-OPENmethods with static queries as well, even after the query has been opened one or more times with a staticOPEN QUERYstatement. Here’s an example that extends the static query shown earlier:
The first alert box, shown in Figure 19–5, confirms that you can’t use the
PREPARE-STRINGattribute on a staticOPEN.Figure 19–5: Static OPEN query message
![]()
But the one in Figure 19–6 shows that you can use it when you prepare and open even a static query using the dynamic methods.
Figure 19–6: Dynamic methods with OPEN query message
![]()
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |